package com.utilcase.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.utilcase.domain.MessageLog;
import com.utilcase.enums.MessageStatus;
import com.utilcase.service.MessageLogService;
import com.utilcase.mapper.MessageLogMapper;
import org.springframework.stereotype.Service;

/**
* @author 44223
* @description 针对表【message_log】的数据库操作Service实现
* @createDate 2024-07-04 11:00:35
*/
@Service
public class MessageLogServiceImpl extends ServiceImpl<MessageLogMapper, MessageLog>
    implements MessageLogService{

    @Override
    public void updateStatus(String orderId, MessageStatus status) {
        // 查找并更新消息表状态 （逻辑删除消息表消息）
        QueryWrapper<MessageLog> msgQuery = new QueryWrapper<>();
        msgQuery.eq("message_id", orderId);
        MessageLog message = this.getOne(msgQuery);
        message.setStatus(status);
        this.updateById(message);
    }
}




